package com.example.day02.p;

import android.view.View;

import com.example.day02.Bean;
import com.example.day02.MainActivity2;

import com.example.day02.m.MainModel;
import com.example.day02.v.CallBack;
import com.example.day02.v.View_Main;

import java.util.List;

public class Persenter implements CallBack {

    View_Main view_main;
    MainModel mainModel;

    public Persenter(View_Main view_main) {
        this.view_main = view_main;
        mainModel=new MainModel();
    }

    @Override
    public void showBean(List<Bean> resultsBeans) {
        view_main.showData(resultsBeans);
    }

    @Override
    public void toast(String s) {
        view_main.showToast(s);
    }
    public void getData(){
        mainModel.getData(this);
    }

    public void upDate(String trim) {
        mainModel.getUpdate(trim,this);

    }
}
